package com.chencs.app.config.service;
import com.chencs.vo.net.request.AdviseRequest;
import com.chencs.vo.net.request.ProductRequest;
import com.chencs.vo.net.request.RequestBase;
import com.chencs.webmvc.rest.RestFullTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Created by Administrator on 2017/10/10.
 */
@Service
public class AppConfigService {

    @Autowired
    RestFullTemplate restTemplate;
    private static final String URLPATH = "service-common/app/config/";

    public String checkVersion(RequestBase request) throws Exception{
        String ret = restTemplate.postForObject(URLPATH + "checkVersion", String.class,request);
        return ret;
    }


    public String getConfig(@RequestBody RequestBase request){
        String ret = restTemplate.postForObject(URLPATH + "getConfig", String.class,request);
        return ret;
    }

    public String addAdvise(@RequestBody AdviseRequest request){
        String ret = restTemplate.postForObject(URLPATH + "addAdvise", String.class,request);
        return ret;
    }


    public String relation(@RequestBody ProductRequest request){
        String ret = restTemplate.postForObject(URLPATH + "relation", String.class,request);
        return ret;
    }

}
